<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <!--[if lt IE 9]>
    <script type="text/javascript" src="/static/ui/lib/html5shiv.js"></script>
    <script type="text/javascript" src="/static/ui/lib/respond.min.js"></script>
    <![endif]-->
    <link rel="stylesheet" type="text/css" href="/static/ui/css/H-ui.min.css" />
    <link rel="stylesheet" type="text/css" href="/static/ui/lib/Hui-iconfont/1.0.8/iconfont.min.css" />
    <!--[if lt IE 9]>
    <link href="/static/ui/css/H-ui.ie.css" rel="stylesheet" type="text/css" />
    <![endif]-->
    <!--[if IE 6]>
    <script type="text/javascript" src="/static/ui/lib/DD_belatedPNG_0.0.8a-min.js" ></script>
    <script>DD_belatedPNG.fix('*');</script>
    <![endif]-->
    <style type="text/css">
        .ui-sortable .panel-header{ cursor:move}
    </style>
    <title>用户登录</title>
    <meta name="keywords" content="关键词,5个左右,单个8汉字以内">
    <meta name="description" content="网站描述，字数尽量空制在80个汉字，160个字符以内！">
</head>
<body ontouchstart>
<div class="containBox">
    <div class="container ui-sortable">
        <div class="panel panel-default">
            <div class="panel-header">用户登录</div>
            <div class="panel-body">
                <!--

                    使用了 thinkphp5的 url生成函数 默认传值为：

                    参数1：模块名/控制器名/方法名

                    参数2：……

                    参数n：……

                 -->
                <form action="{:url('index/Sign/in')}" method="post" class="form form-horizontal responsive" id="signUp">
                    <div class="row cl">
                        <label class="form-label col-xs-3">邮箱：</label>
                        <div class="formControls col-xs-8">
                            <input type="text" class="input-text" placeholder="@" name="email" autocomplete="off">
                        </div>
                    </div>
                    <div class="row cl">
                        <label class="form-label col-xs-3">密码：</label>
                        <div class="formControls col-xs-8">
                            <input type="password" class="input-text" autocomplete="off" placeholder="密码" name="password">
                        </div>
                    </div>
                    <div class="row cl">
                        <div class="col-xs-8 col-xs-offset-3">
                            <input class="btn btn-primary" type="submit" value="&nbsp;&nbsp;登录&nbsp;&nbsp;">
                            <span><a href="{:url('index/Sign/up')}">注册</a></span>
                            <span><a href="{:url('index/Member/index')}">个人中心</a></span>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>


<script type="text/javascript" src="/static/ui/lib/jquery/1.9.1/jquery.min.js"></script>
<!--<script type="text/javascript" src="/static/ui/lib/jquery-ui/1.9.1/jquery-ui.min.js"></script>-->
<script type="text/javascript" src="/static/ui/lib/jquery.validation/1.14.0/jquery.validate.min.js"></script>
<script type="text/javascript" src="/static/ui/lib/layer/3.1/layer.js"></script>
<script type="text/javascript" src="/static/ui/js/H-ui.js"></script>
<script>

    // 使用了jquery的表单验证插件
    $("#signUp").validate({
        //定义的是表单验证的规则
        rules: {
            password: {
                required: true,
                minlength: 6,
                //该控件的的最大长度不能大于12
                maxlength: 12
            },

            email: {
                required: true,
                //输入的必须是个合法的email
                email: true
            }
        },
        //表单验证失败的时候的提示信息
        messages: {
            password: {
                required: "请输入密码",
                minlength: "密码长度不能小于6个字符",
                maxlength: "密码长度不能大于12个字符"
            },
            email: "请输入一个正确的邮箱"
        },
        //修改提交操作，默认提交操作是submit控件被点击的时候。
        //使用了ajax提交
        submitHandler:function (form) {

            $(form).ajaxSubmit(function (e) {
                console.log(e);
                //ajax提交后的返回值
                if(!e.code){
                    layer.alert(e.info)
                }else{
                    window.location.href = "{:url('index/Member/index') }";
                }
            });

        }
    })


</script>
</body>
</html>